<style>
    .wd300{
        width: 300px;
    }
</style>
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="MenuTable">
    <div class="layui-card-body">
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('商品编号')}</label>
            <div class="layui-input-block">
                <input name="goods_no" value='{$vo.goods_no|default=""}' 
                required vali-name="登录账号" placeholder="请输入登录账号" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('商品图片')}</label>
            <div class="layui-input-block help-images">
                 <input type="hidden" value="{$vo.goods_pic|default=""}" name="goods_pic">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('商品名称')}</label>
            <div class="layui-input-block">
                <input name="goods_name" value='{$vo.goods_name|default=""}' 
                required vali-name="商品名称" placeholder="请输入商品名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('需积分数')}</label>
            <div class="layui-input-block">
                <input name="integral" value='{$vo.integral|default=""}' 
                required vali-name="需积分数" placeholder="请输入需积分数" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('需支付金额')}</label>
            <div class="layui-input-block">
                <input name="amount" value='{$vo.amount|default=""}' 
                type="number"
                required vali-name="需支付金额" placeholder="请输入需支付金额" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('商品库存')}</label>
            <div class="layui-input-block">
                <input name="stock" value='{$vo.stock|default=""}' 
                type="number"
                required vali-name="商品库存" placeholder="请输入商品库存" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('商品类型')}</label>
            <div class="layui-input-block">
                 <input type="radio" name="goods_type" value="1" {if($vo["goods_type"] == 1)} checked  {/if} title="用户商品">
                 <input type="radio" name="goods_type" value="2" {if($vo["goods_type"] == 2)} checked  {/if} title="经销商" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('商品状态')}</label>
            <div class="layui-input-block">
                 <input type="radio" name="status" value="0" {if($vo["status"] == 0)} checked  {/if} title="下架">
                 <input type="radio" name="status" value="1" {if($vo["status"] == 1)} checked  {/if} title="上架" >
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>{:lang('保存数据')}</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="{:lang('确定要取消编辑吗？')}" data-close>{:lang('取消编辑')}</button>
    </div>
</form>


<script>
$('[name=goods_pic]').uploadOneImage();
    require(['md5'], function (md5) {
        $('body').off('click', '#RefreshJwtKey').on('click', '#RefreshJwtKey', function () {
            $(this).parent().find('input').val(md5.hash(Date.toString() + Math.random()));
        });
});
 
</script>














